package com.yc.blog.biz.impl;

import java.util.List;

import com.yc.blog.bean.AdminInfo;
import com.yc.blog.biz.IAdminInfoBiz;
import com.yc.blog.dao.IAdminInfoDao;
import com.yc.blog.dao.impl.AdminInfoDaoImpl;
import com.yc.blog.util.StringUtil;

public class AdminInfoBizImpl implements IAdminInfoBiz{

	@Override
	public AdminInfo login(String aname, String pwd) {
		if(StringUtil.chekNUll(aname,pwd)) {
			return null;
		}
		
		IAdminInfoDao adminInfoDao = new AdminInfoDaoImpl();
		return adminInfoDao.login(aname, pwd);
	}

	@Override
	public int add(String aname, String pwd, String photo) {
		if(StringUtil.chekNUll(aname,pwd)) {
			return -1;
		}
		
		IAdminInfoDao adminInfoDao = new AdminInfoDaoImpl();
		return adminInfoDao.add(aname, pwd, photo);
	}

	@Override
	public List<AdminInfo> findAll() {
		IAdminInfoDao adminInfoDao = new AdminInfoDaoImpl();
		return adminInfoDao.findAll();
	}

}
